<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="JAVAWEB," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="一人一椅一壶茶，清坐林间看落花。 蜂飞蝶舞不着意，淡月清风逐晚霞。  分页PageBean类的设计12345678910111213141516171819202122232425262728293031323334353637383940414243public class PageBean &amp;#123;	//省略了GetSet方法	private Integer currentPage; /">
<meta name="keywords" content="JAVAWEB">
<meta property="og:type" content="article">
<meta property="og:title" content="Crm总结">
<meta property="og:url" content="http://yoursite.com/2017/05/15/Crm总结/index.html">
<meta property="og:site_name" content="JokerLiang">
<meta property="og:description" content="一人一椅一壶茶，清坐林间看落花。 蜂飞蝶舞不着意，淡月清风逐晚霞。  分页PageBean类的设计12345678910111213141516171819202122232425262728293031323334353637383940414243public class PageBean &amp;#123;	//省略了GetSet方法	private Integer currentPage; /">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2017-05-15T07:08:10.707Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Crm总结">
<meta name="twitter:description" content="一人一椅一壶茶，清坐林间看落花。 蜂飞蝶舞不着意，淡月清风逐晚霞。  分页PageBean类的设计12345678910111213141516171819202122232425262728293031323334353637383940414243public class PageBean &amp;#123;	//省略了GetSet方法	private Integer currentPage; /">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"always"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2017/05/15/Crm总结/"/>





  <title> Crm总结 | JokerLiang </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  








  <div style="display: none;">
    <script src="//s95.cnzz.com/z_stat.php?id=1260895995&web_id=1260895995" language="JavaScript"></script>
  </div>





  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">JokerLiang</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">永远年轻，永远热泪盈眶。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>


    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/05/15/Crm总结/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="JokerLiang">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/me.jpg">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="JokerLiang">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="JokerLiang" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Crm总结
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-05-15T15:07:29+08:00">
                2017-05-15
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/JAVAWEB/" itemprop="url" rel="index">
                    <span itemprop="name">JAVAWEB</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <blockquote>
<p>&#x4E00;&#x4EBA;&#x4E00;&#x6905;&#x4E00;&#x58F6;&#x8336;&#xFF0C;&#x6E05;&#x5750;&#x6797;&#x95F4;&#x770B;&#x843D;&#x82B1;&#x3002; &#x8702;&#x98DE;&#x8776;&#x821E;&#x4E0D;&#x7740;&#x610F;&#xFF0C;&#x6DE1;&#x6708;&#x6E05;&#x98CE;&#x9010;&#x665A;&#x971E;&#x3002;</p>
</blockquote>
<h2 id="&#x5206;&#x9875;PageBean&#x7C7B;&#x7684;&#x8BBE;&#x8BA1;"><a href="#&#x5206;&#x9875;PageBean&#x7C7B;&#x7684;&#x8BBE;&#x8BA1;" class="headerlink" title="&#x5206;&#x9875;PageBean&#x7C7B;&#x7684;&#x8BBE;&#x8BA1;"></a>&#x5206;&#x9875;PageBean&#x7C7B;&#x7684;&#x8BBE;&#x8BA1;</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">PageBean</span> </span>{</span><br><span class="line">	<span class="comment">//&#x7701;&#x7565;&#x4E86;GetSet&#x65B9;&#x6CD5;</span></span><br><span class="line">	<span class="keyword">private</span> Integer currentPage; <span class="comment">//&#x5F53;&#x524D;&#x9875;&#x6570;</span></span><br><span class="line">	<span class="keyword">private</span> Integer totalCount;  <span class="comment">//&#x603B;&#x8BB0;&#x5F55;&#x6570;</span></span><br><span class="line">	<span class="keyword">private</span> Integer pageSize; <span class="comment">// &#x6BCF;&#x9875;&#x8BB0;&#x5F55;&#x6761;&#x6570;</span></span><br><span class="line">	<span class="keyword">private</span> Integer totalPage; <span class="comment">//&#x603B;&#x9875;&#x6570;</span></span><br><span class="line">	<span class="keyword">private</span> List  list ; <span class="comment">// &#x6BCF;&#x9875;&#x7684;&#x6570;&#x636E;</span></span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">PageBean</span><span class="params">(Integer currentPage, Integer totalCount, Integer pageSize)</span> </span>{</span><br><span class="line">		<span class="keyword">this</span>.totalCount = totalCount; </span><br><span class="line">		</span><br><span class="line">		<span class="keyword">this</span>.currentPage = currentPage;</span><br><span class="line">		</span><br><span class="line">		<span class="keyword">this</span>.pageSize = pageSize;</span><br><span class="line">		</span><br><span class="line">		<span class="keyword">if</span>(<span class="keyword">this</span>.currentPage == <span class="keyword">null</span>){</span><br><span class="line">			<span class="comment">//&#x5982;&#x679C;&#x6CA1;&#x6709;&#x9009;&#x62E9;&#x9875;&#x7801;&#xFF0C;&#x5C31;&#x770B;&#x7B2C;&#x4E00;&#x9875;</span></span><br><span class="line">			<span class="keyword">this</span>.currentPage = <span class="number">1</span>;</span><br><span class="line">		}</span><br><span class="line">		</span><br><span class="line">		<span class="keyword">if</span>(<span class="keyword">this</span>.pageSize == <span class="keyword">null</span>){</span><br><span class="line">			<span class="comment">//&#x6CA1;&#x6709;&#x9009;&#x62E9;&#x6BCF;&#x9875;&#x663E;&#x793A;&#x7684;&#x6761;&#x6570;&#xFF0C;&#x5219;&#x9ED8;&#x8BA4;&#x663E;&#x793A;2&#x6761;</span></span><br><span class="line">			<span class="keyword">this</span>.pageSize = <span class="number">2</span>;</span><br><span class="line">		}</span><br><span class="line">		</span><br><span class="line">		<span class="comment">//&#x8BA1;&#x7B97;&#x603B;&#x9875;&#x6570;</span></span><br><span class="line">		<span class="keyword">this</span>.totalPage = <span class="keyword">this</span>.totalCount % <span class="keyword">this</span>.pageSize == <span class="number">0</span> ?<span class="keyword">this</span>.totalCount / <span class="keyword">this</span>.pageSize : (<span class="keyword">this</span>.totalCount / <span class="keyword">this</span>.pageSize)+<span class="number">1</span>;</span><br><span class="line">		</span><br><span class="line">		<span class="comment">//&#x5224;&#x65AD;&#x5F53;&#x524D;&#x9875;&#x6570;&#x662F;&#x5426;&#x8D85;&#x51FA;&#x8303;&#x56F4;</span></span><br><span class="line">		<span class="keyword">if</span>(<span class="keyword">this</span>.currentPage&lt; <span class="number">1</span>){</span><br><span class="line">			<span class="keyword">this</span>.currentPage = <span class="number">1</span>;</span><br><span class="line">		}</span><br><span class="line">		<span class="keyword">if</span>(<span class="keyword">this</span>.currentPage&gt;<span class="keyword">this</span>.totalPage){</span><br><span class="line">			<span class="keyword">this</span>.currentPage = <span class="keyword">this</span>.totalPage ;</span><br><span class="line">		}</span><br><span class="line">		</span><br><span class="line">	</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">	<span class="comment">//&#x8BA1;&#x7B97;&#x8D77;&#x59CB;&#x7D22;&#x5F15;</span></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">int</span> <span class="title">getStart</span><span class="params">()</span></span>{</span><br><span class="line">		<span class="keyword">return</span> (<span class="keyword">this</span>.currentPage-<span class="number">1</span>)*<span class="keyword">this</span>.pageSize;</span><br><span class="line">	}</span><br></pre></td></tr></table></figure>
<a id="more"></a>
<h2 id="BaseDao-&#x8BBE;&#x8BA1;"><a href="#BaseDao-&#x8BBE;&#x8BA1;" class="headerlink" title="BaseDao &#x8BBE;&#x8BA1;"></a>BaseDao &#x8BBE;&#x8BA1;</h2><h3 id="&#x63A5;&#x53E3;&#x4E66;&#x5199;"><a href="#&#x63A5;&#x53E3;&#x4E66;&#x5199;" class="headerlink" title="&#x63A5;&#x53E3;&#x4E66;&#x5199;"></a>&#x63A5;&#x53E3;&#x4E66;&#x5199;</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">interface</span> <span class="title">BaseDao</span>&lt;<span class="title">T</span>&gt; </span>{</span><br><span class="line">	<span class="comment">//&#x4FDD;&#x5B58;&#x6216;&#x8005;&#x4FEE;&#x6539;&#xFF08;Hibenate&#x4F1A;&#x6839;&#x636E;&#x6709;&#x6CA1;&#x6709;Id&#x6765;&#x81EA;&#x52A8;&#x5224;&#x65AD;&#x7D2F;&#x5FC3;&#xFF09;</span></span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">saveOrUpdate</span><span class="params">(T t)</span></span>;</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">save</span><span class="params">(T t)</span></span>;</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">delect</span><span class="params">(T t)</span></span>;</span><br><span class="line">	</span><br><span class="line">	<span class="comment">//&#x6839;&#x636E;Id&#x6765;&#x5220;&#x9664; &#xFF0C;&#x56E0;&#x4E3A;&#x6240;&#x6709;&#x7684;&#x57FA;&#x672C;&#x7C7B;&#x578B;&#x90FD;&#x5B9E;&#x73B0;&#x4E86;Serializable&#x63A5;&#x53E3;&#xFF0C;&#x6240;&#x4EE5;&#x53C2;&#x6570;&#x53EF;&#x4EE5;&#x5199;&#x8FD9;&#x4E2A;&#x3002;</span></span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">delect</span><span class="params">(Serializable id)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">void</span> <span class="title">update</span><span class="params">(T t)</span></span>;</span><br><span class="line">	</span><br><span class="line">	<span class="function">T <span class="title">getById</span><span class="params">(Serializable id)</span></span>;</span><br><span class="line">	</span><br><span class="line">	<span class="comment">//&#x6839;&#x636E;&#x79BB;&#x7EBF;&#x67E5;&#x8BE2;&#x5BF9;&#x8C61;&#x6765;&#x83B7;&#x53D6;&#x6240;&#x6709;&#x8BB0;&#x5F55;&#x6570;</span></span><br><span class="line">	<span class="function">Integer <span class="title">getTotalCount</span><span class="params">(DetachedCriteria dc)</span></span>;</span><br><span class="line"></span><br><span class="line">	<span class="comment">/**</span></span><br><span class="line"><span class="comment">	 * &#x67E5;&#x8BE2;&#x5206;&#x9875;&#x6570;&#x636E; </span></span><br><span class="line"><span class="comment">	 * <span class="doctag">@param</span> dc &#x67E5;&#x8BE2;&#x6761;&#x4EF6;</span></span><br><span class="line"><span class="comment">	 * <span class="doctag">@param</span> start &#x5F00;&#x59CB;&#x7684;&#x7D22;&#x5F15; </span></span><br><span class="line"><span class="comment">	 * <span class="doctag">@param</span> pageSize &#x6BCF;&#x9875;&#x7684;&#x4E2A;&#x6570;</span></span><br><span class="line"><span class="comment">	 * <span class="doctag">@return</span></span></span><br><span class="line"><span class="comment">	 */</span></span><br><span class="line">	<span class="function">List&lt;T&gt; <span class="title">getPageList</span><span class="params">(DetachedCriteria dc , Integer start , Integer pageSize)</span></span>;</span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<h3 id="BaseDaoImpl-&#x7684;&#x4E66;&#x5199;"><a href="#BaseDaoImpl-&#x7684;&#x4E66;&#x5199;" class="headerlink" title="BaseDaoImpl &#x7684;&#x4E66;&#x5199;"></a>BaseDaoImpl &#x7684;&#x4E66;&#x5199;</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">BaseDaoImpl</span>&lt;<span class="title">T</span>&gt; <span class="keyword">extends</span> <span class="title">HibernateDaoSupport</span> <span class="keyword">implements</span> <span class="title">BaseDao</span>&lt;<span class="title">T</span>&gt; </span>{</span><br><span class="line"></span><br><span class="line">	<span class="keyword">private</span> Class clazz;</span><br><span class="line"></span><br><span class="line">	<span class="comment">//&#x53CD;&#x5C04;&#x6280;&#x672F;&#x62FF;&#x5230;&#x4E0B;&#x9762;&#x6240;&#x9700;&#x8981;&#x7684;&#x53C2;&#x6570;&#x7C7B;&#x578B;</span></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="title">BaseDaoImpl</span><span class="params">()</span></span>{</span><br><span class="line">		ParameterizedType ptClass =  (ParameterizedType) <span class="keyword">this</span>.getClass().getGenericSuperclass();</span><br><span class="line">		clazz = (Class) ptClass.getActualTypeArguments()[<span class="number">0</span>];</span><br><span class="line">	}</span><br><span class="line">	</span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> T <span class="title">getById</span><span class="params">(Serializable id)</span> </span>{</span><br><span class="line">		<span class="keyword">return</span> (T) getHibernateTemplate().get(clazz, id);</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">saveOrUpdate</span><span class="params">(T t)</span> </span>{</span><br><span class="line">		getHibernateTemplate().saveOrUpdate(t);</span><br><span class="line">		</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">save</span><span class="params">(T t)</span> </span>{</span><br><span class="line">		getHibernateTemplate().save(t);</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">delect</span><span class="params">(T t)</span> </span>{</span><br><span class="line">		getHibernateTemplate().delete(t);</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">delect</span><span class="params">(Serializable id)</span> </span>{</span><br><span class="line">		<span class="comment">//&#x5982;&#x679C;&#x6839;&#x636E;Id&#x9700;&#x8981;&#x5148;&#x53D6;&#x518D;&#x5220;</span></span><br><span class="line">		T t = <span class="keyword">this</span>.getById(id);</span><br><span class="line">		getHibernateTemplate().delete(t);</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">update</span><span class="params">(T t)</span> </span>{</span><br><span class="line">		getHibernateTemplate().update(t);</span><br><span class="line">		</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">public</span> Integer <span class="title">getTotalCount</span><span class="params">(DetachedCriteria dc)</span> </span>{</span><br><span class="line">		dc.setProjection(Projections.rowCount());</span><br><span class="line">		List&lt;Long&gt; list = (List&lt;Long&gt;) getHibernateTemplate().findByCriteria(dc);</span><br><span class="line">		dc.setProjection(<span class="keyword">null</span>);</span><br><span class="line">		<span class="keyword">if</span>(list!=<span class="keyword">null</span>&amp;&amp;list.size()&gt;<span class="number">0</span>){</span><br><span class="line">			Long count = list.get(<span class="number">0</span>);</span><br><span class="line">			<span class="keyword">return</span> count.intValue();</span><br><span class="line">		}</span><br><span class="line">		<span class="keyword">return</span> <span class="keyword">null</span>;</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">public</span> List&lt;T&gt; <span class="title">getPageList</span><span class="params">(DetachedCriteria dc, Integer start,</span></span></span><br><span class="line"><span class="function"><span class="params">			Integer pageSize)</span> </span>{</span><br><span class="line">		<span class="keyword">return</span> (List&lt;T&gt;) getHibernateTemplate().findByCriteria(dc, start, pageSize);</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<h2 id="Struts2&#x62E6;&#x622A;&#x5668;"><a href="#Struts2&#x62E6;&#x622A;&#x5668;" class="headerlink" title="Struts2&#x62E6;&#x622A;&#x5668;"></a>Struts2&#x62E6;&#x622A;&#x5668;</h2><h3 id="&#x4E66;&#x5199;&#x62E6;&#x622A;&#x5668;&#x7C7B;"><a href="#&#x4E66;&#x5199;&#x62E6;&#x622A;&#x5668;&#x7C7B;" class="headerlink" title="&#x4E66;&#x5199;&#x62E6;&#x622A;&#x5668;&#x7C7B;"></a>&#x4E66;&#x5199;&#x62E6;&#x622A;&#x5668;&#x7C7B;</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">privilegeInterceptor</span> <span class="keyword">extends</span> <span class="title">MethodFilterInterceptor</span> </span>{</span><br><span class="line"></span><br><span class="line">	<span class="meta">@Override</span></span><br><span class="line">	<span class="comment">//&#x4E0D;&#x68C0;&#x9A8C;&#x767B;&#x9646;&#x548C;&#x6CE8;&#x518C;</span></span><br><span class="line">	<span class="function"><span class="keyword">protected</span> String <span class="title">doIntercept</span><span class="params">(ActionInvocation invocation)</span> <span class="keyword">throws</span> Exception </span>{</span><br><span class="line">		<span class="comment">//1:&#x83B7;&#x5F97;Session,&#x83B7;&#x5F97;&#x767B;&#x9646;&#x8868;&#x793A;</span></span><br><span class="line">		User user=  (User) ActionContext.getContext().getSession().get(<span class="string">&quot;user&quot;</span>);</span><br><span class="line">		<span class="comment">//&#x5224;&#x65AD;&#x662F;&#x5426;&#x767B;&#x9646;</span></span><br><span class="line">		<span class="keyword">if</span>(user!=<span class="keyword">null</span>){</span><br><span class="line">			<span class="comment">//1&#xFF1A;&#x5B58;&#x5728;&#xFF0C;&#x653E;&#x884C;</span></span><br><span class="line">			<span class="keyword">return</span> invocation.invoke();</span><br><span class="line">		}</span><br><span class="line">		<span class="comment">//2: &#x4E0D;&#x5B58;&#x5728; &#x91CD;&#x5B9A;&#x5411;&#x767B;&#x9646;&#x9875;&#x9762;</span></span><br><span class="line">		<span class="keyword">return</span> <span class="string">&quot;toLogin&quot;</span>;</span><br><span class="line">	}</span><br><span class="line"></span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<h3 id="&#x5728;Struts2&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x914D;&#x7F6E;"><a href="#&#x5728;Struts2&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x914D;&#x7F6E;" class="headerlink" title="&#x5728;Struts2&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x914D;&#x7F6E;"></a>&#x5728;Struts2&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x914D;&#x7F6E;</h3><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">interceptors</span>&gt;</span></span><br><span class="line">	<span class="comment">&lt;!-- &#x6CE8;&#x518C;&#x62E6;&#x622A;&#x5668; --&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">interceptor</span> <span class="attr">name</span>=<span class="string">&quot;privilegeInterceptor&quot;</span> <span class="attr">class</span>=<span class="string">&quot;com.joker.web.interceptor.privilegeInterceptor&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">interceptor</span>&gt;</span></span><br><span class="line">	<span class="comment">&lt;!-- &#x914D;&#x7F6E;&#x62E6;&#x622A;&#x5668;&#x6808; --&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">interceptor-stack</span> <span class="attr">name</span>=<span class="string">&quot;myStack&quot;</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">interceptor-ref</span> <span class="attr">name</span>=<span class="string">&quot;privilegeInterceptor&quot;</span>&gt;</span></span><br><span class="line">			<span class="comment">&lt;!-- &#x914D;&#x7F6E;&#x5236;&#x5B9A;&#x65B9;&#x6CD5;&#x4E0D;&#x62E6;&#x622A; --&gt;</span></span><br><span class="line">			<span class="tag">&lt;<span class="name">param</span> <span class="attr">name</span>=<span class="string">&quot;excludeMethods&quot;</span>&gt;</span>login,regist<span class="tag">&lt;/<span class="name">param</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;/<span class="name">interceptor-ref</span>&gt;</span></span><br><span class="line">		<span class="comment">&lt;!-- &#x5F15;&#x5165;Struts2&#x7684;&#x9ED8;&#x8BA4;&#x62E6;&#x622A;&#x5668;&#x6808; --&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">interceptor-ref</span> <span class="attr">name</span>=<span class="string">&quot;defaultStack&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">interceptor-ref</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">interceptor-stack</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">interceptors</span>&gt;</span></span><br><span class="line"><span class="comment">&lt;!-- &#x5236;&#x5B9A;&#x9ED8;&#x8BA4;&#x62E6;&#x622A;&#x5668; --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">default-interceptor-ref</span> <span class="attr">name</span>=<span class="string">&quot;myStack&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">default-interceptor-ref</span>&gt;</span></span><br></pre></td></tr></table></figure>
<h2 id="Spring&#x914D;&#x7F6E;"><a href="#Spring&#x914D;&#x7F6E;" class="headerlink" title="Spring&#x914D;&#x7F6E;"></a>Spring&#x914D;&#x7F6E;</h2><h3 id="&#x5BFC;&#x7EA6;&#x675F;"><a href="#&#x5BFC;&#x7EA6;&#x675F;" class="headerlink" title="&#x5BFC;&#x7EA6;&#x675F;"></a>&#x5BFC;&#x7EA6;&#x675F;</h3><ul>
<li>xsi</li>
<li>aop</li>
<li>context</li>
<li>tx<h3 id="Hibernate&#x76F8;&#x5173;"><a href="#Hibernate&#x76F8;&#x5173;" class="headerlink" title="Hibernate&#x76F8;&#x5173;"></a>Hibernate&#x76F8;&#x5173;</h3><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- &#x5F15;&#x5165;&#x5916;&#x90E8;&#x6587;&#x4EF6; --&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">context:property-placeholder</span> <span class="attr">location</span>=<span class="string">&quot;classpath:db.properties&quot;</span>/&gt;</span></span><br><span class="line"><span class="comment">&lt;!-- C3p0 --&gt;</span></span><br><span class="line">	</span><br><span class="line">	<span class="tag">&lt;<span class="name">bean</span> <span class="attr">name</span>=<span class="string">&quot;dataSource&quot;</span> <span class="attr">class</span>=<span class="string">&quot;com.mchange.v2.c3p0.ComboPooledDataSource&quot;</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;jdbcUrl&quot;</span> <span class="attr">value</span>=<span class="string">&quot;${jdbc_jdbcUrl}&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;driverClass&quot;</span> <span class="attr">value</span>=<span class="string">&quot;${jdbc_driverClass}&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;user&quot;</span> <span class="attr">value</span>=<span class="string">&quot;${jdbc_user}&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;password&quot;</span> <span class="attr">value</span>=<span class="string">&quot;${jdbc_password}&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">bean</span>&gt;</span></span><br><span class="line">		<span class="comment">&lt;!--  &#x6838;&#x5FC3;&#x4E8B;&#x52A1;&#x7BA1;&#x7406;&#x5668; --&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">bean</span> <span class="attr">name</span>=<span class="string">&quot;transactionManager&quot;</span> <span class="attr">class</span>=<span class="string">&quot;org.springframework.orm.hibernate5.HibernateTransactionManager&quot;</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;sessionFactory&quot;</span> <span class="attr">ref</span>=<span class="string">&quot;sessionFactory&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">bean</span>&gt;</span></span><br><span class="line">	</span><br><span class="line">	<span class="tag">&lt;<span class="name">bean</span> <span class="attr">name</span>=<span class="string">&quot;sessionFactory&quot;</span> <span class="attr">class</span>=<span class="string">&quot;org.springframework.orm.hibernate5.LocalSessionFactoryBean&quot;</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;dataSource&quot;</span> <span class="attr">ref</span>=<span class="string">&quot;dataSource&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">		<span class="comment">&lt;!-- -&#x5F15;&#x5165;&#x5143;&#x6570;&#x636E; --&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;hibernateProperties&quot;</span>&gt;</span></span><br><span class="line">			<span class="tag">&lt;<span class="name">props</span>&gt;</span></span><br><span class="line">				<span class="tag">&lt;<span class="name">prop</span> <span class="attr">key</span>=<span class="string">&quot;hibernate.dialect&quot;</span> &gt;</span>org.hibernate.dialect.MySQLDialect<span class="tag">&lt;/<span class="name">prop</span>&gt;</span></span><br><span class="line">				<span class="tag">&lt;<span class="name">prop</span> <span class="attr">key</span>=<span class="string">&quot;hibernate.show_sql&quot;</span> &gt;</span>true<span class="tag">&lt;/<span class="name">prop</span>&gt;</span></span><br><span class="line">				<span class="tag">&lt;<span class="name">prop</span> <span class="attr">key</span>=<span class="string">&quot;hibernate.format_sql&quot;</span> &gt;</span>true<span class="tag">&lt;/<span class="name">prop</span>&gt;</span></span><br><span class="line">				<span class="tag">&lt;<span class="name">prop</span> <span class="attr">key</span>=<span class="string">&quot;hibernate.hbm2ddl.auto&quot;</span> &gt;</span>update<span class="tag">&lt;/<span class="name">prop</span>&gt;</span></span><br><span class="line">			<span class="tag">&lt;/<span class="name">props</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;mappingDirectoryLocations&quot;</span> <span class="attr">value</span>=<span class="string">&quot;classpath:com/joker/domain&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">bean</span>&gt;</span></span><br></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="Struts2&#x76F8;&#x5173;"><a href="#Struts2&#x76F8;&#x5173;" class="headerlink" title="Struts2&#x76F8;&#x5173;"></a>Struts2&#x76F8;&#x5173;</h3><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- &#x5C06;Struts2&#x4EA4;&#x7ED9;Spring&#x6765;&#x7BA1;&#x7406;&#xFF0C;&#x4E3B;&#x8981;&#x4F53;&#x73B0;&#x5728;Action Class&#x90A3;&#x91CC;&#x5199;-&#x5728;Spring&#x4E2D;Bean&#x914D;&#x7F6E;&#x7684;&#x540D;&#x5B57; --&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">constant</span> <span class="attr">name</span>=<span class="string">&quot;struts.objectFactory&quot;</span> <span class="attr">value</span>=<span class="string">&quot;spring&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">constant</span>&gt;</span></span><br></pre></td></tr></table></figure>
<h3 id="Spring&#x76F8;&#x5173;"><a href="#Spring&#x76F8;&#x5173;" class="headerlink" title="Spring&#x76F8;&#x5173;"></a>Spring&#x76F8;&#x5173;</h3><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- &#x5F00;&#x542F;&#x6CE8;&#x89E3;&#x914D;&#x7F6E;Spring --&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">context:component-scan</span> <span class="attr">base-package</span>=<span class="string">&quot;com.joker&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">context:component-scan</span>&gt;</span></span><br><span class="line"></span><br><span class="line">	<span class="tag">&lt;<span class="name">bean</span> <span class="attr">name</span>=<span class="string">&quot;userDao&quot;</span> <span class="attr">class</span>=<span class="string">&quot;com.joker.dao.impl.UserDaoImpl&quot;</span> &gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;sessionFactory&quot;</span> <span class="attr">ref</span>=<span class="string">&quot;sessionFactory&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">bean</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">bean</span> <span class="attr">name</span>=<span class="string">&quot;userService&quot;</span> <span class="attr">class</span>=<span class="string">&quot;com.joker.service.impl.UserServiceImpl&quot;</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;ud&quot;</span> <span class="attr">ref</span>=<span class="string">&quot;userDao&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">bean</span>&gt;</span></span><br><span class="line">	</span><br><span class="line">	<span class="tag">&lt;<span class="name">bean</span> <span class="attr">name</span>=<span class="string">&quot;userAction&quot;</span> <span class="attr">class</span>=<span class="string">&quot;com.joker.web.action.UserAction&quot;</span> <span class="attr">scope</span>=<span class="string">&quot;prototype&quot;</span>&gt;</span></span><br><span class="line">		<span class="tag">&lt;<span class="name">property</span> <span class="attr">name</span>=<span class="string">&quot;us&quot;</span> <span class="attr">ref</span>=<span class="string">&quot;userService&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">property</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;/<span class="name">bean</span>&gt;</span></span><br></pre></td></tr></table></figure>
<h2 id="&#x524D;&#x53F0;&#x9875;&#x9762;"><a href="#&#x524D;&#x53F0;&#x9875;&#x9762;" class="headerlink" title="&#x524D;&#x53F0;&#x9875;&#x9762;"></a>&#x524D;&#x53F0;&#x9875;&#x9762;</h2><ul>
<li>&#x5982;&#x679C;&#x60F3;&#x8981;&#x63D0;&#x4EA4;&#x81EA;&#x5DF1;&#x5236;&#x5B9A;&#x7684;&#x6570;&#x636E;&#x7ED9;&#x540E;&#x53F0;&#x800C;&#x4E0D;&#x662F;&#x8BA9;&#x7528;&#x6237;&#x586B;&#x5199;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;input type=&#x2019;hidden&#x2019;</li>
<li>&#x7528;JS&#x6253;&#x5F00;&#x4E00;&#x4E2A;&#x5C0F;&#x7A97;&#x53E3;  onClick = &#x201C;window.open(&#x2018;url&#x5730;&#x5740;&#x2019;,&#x2019;&#x2019;,&#x2019;width=600,height=300&#x2019;)&#x201D;</li>
<li></li>
</ul>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/JAVAWEB/" rel="tag"># JAVAWEB</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/05/02/Spring1-简单入门，WEB端的整合/" rel="next" title="Spring1-简单入门，WEB端的整合">
                <i class="fa fa-chevron-left"></i> Spring1-简单入门，WEB端的整合
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/05/17/数据库-oracle基础/" rel="prev" title="数据库-oracle基础">
                数据库-oracle基础 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/me.jpg"
               alt="JokerLiang" />
          <p class="site-author-name" itemprop="name">JokerLiang</p>
          <p class="site-description motion-element" itemprop="description">永远年轻，永远热泪盈眶。</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">61</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">15</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">17</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/LoverJoker" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.zhihu.com/people/lover-easy-7/activities" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/2292572142/profile?rightmod=1&wvr=6&mod=personinfo" target="_blank" title="微博">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  微博
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Friends
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.knight.ac.cn/" title="Knight" target="_blank">Knight</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://lzllzl.cn/" title="Zayvion" target="_blank">Zayvion</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://chen97.com/" title="Chens" target="_blank">Chens</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#分页PageBean类的设计"><span class="nav-number">1.</span> <span class="nav-text">分页PageBean类的设计</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#BaseDao-设计"><span class="nav-number">2.</span> <span class="nav-text">BaseDao 设计</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#接口书写"><span class="nav-number">2.1.</span> <span class="nav-text">接口书写</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#BaseDaoImpl-的书写"><span class="nav-number">2.2.</span> <span class="nav-text">BaseDaoImpl 的书写</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Struts2拦截器"><span class="nav-number">3.</span> <span class="nav-text">Struts2拦截器</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#书写拦截器类"><span class="nav-number">3.1.</span> <span class="nav-text">书写拦截器类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#在Struts2配置文件中配置"><span class="nav-number">3.2.</span> <span class="nav-text">在Struts2配置文件中配置</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Spring配置"><span class="nav-number">4.</span> <span class="nav-text">Spring配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#导约束"><span class="nav-number">4.1.</span> <span class="nav-text">导约束</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Hibernate相关"><span class="nav-number">4.2.</span> <span class="nav-text">Hibernate相关</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Struts2相关"><span class="nav-number">4.3.</span> <span class="nav-text">Struts2相关</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Spring相关"><span class="nav-number">4.4.</span> <span class="nav-text">Spring相关</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#前台页面"><span class="nav-number">5.</span> <span class="nav-text">前台页面</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">JokerLiang</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  



  




	




  
  
  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length == 0) {
      search_path = "search.xml";
    }
    var path = "/" + search_path;
    // monitor main search box;

    function proceedsearch() {
      $("body").append('<div class="popoverlay">').css('overflow', 'hidden');
      $('.popup').toggle();
    }
    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';
      $.ajax({
        url: path,
        dataType: "xml",
        async: true,
        success: function( xmlResponse ) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = $( "entry", xmlResponse ).map(function() {
            return {
              title: $( "title", this ).text(),
              content: $("content",this).text(),
              url: $( "url" , this).text()
            };
          }).get();
          var $input = document.getElementById(search_id);
          var $resultContent = document.getElementById(content_id);
          $input.addEventListener('input', function(){
            var matchcounts = 0;
            var str='<ul class=\"search-result-list\">';
            var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
            $resultContent.innerHTML = "";
            if (this.value.trim().length > 1) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var content_index = [];
                var data_title = data.title.trim().toLowerCase();
                var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase();
                var data_url = decodeURIComponent(data.url);
                var index_title = -1;
                var index_content = -1;
                var first_occur = -1;
                // only match artiles with not empty titles and contents
                if(data_title != '') {
                  keywords.forEach(function(keyword, i) {
                    index_title = data_title.indexOf(keyword);
                    index_content = data_content.indexOf(keyword);
                    if( index_title >= 0 || index_content >= 0 ){
                      isMatch = true;
                      if (i == 0) {
                        first_occur = index_content;
                      }
                    }

                  });
                }
                // show search results
                if (isMatch) {
                  matchcounts += 1;
                  str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>";
                  var content = data.content.trim().replace(/<[^>]+>/g,"");
                  if (first_occur >= 0) {
                    // cut out 100 characters
                    var start = first_occur - 20;
                    var end = first_occur + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if(start == 0){
                      end = 50;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    var match_content = content.substring(start, end);
                    // highlight all keywords
                    keywords.forEach(function(keyword){
                      var regS = new RegExp(keyword, "gi");
                      match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>");
                    });

                    str += "<p class=\"search-result\">" + match_content +"...</p>"
                  }
                  str += "</li>";
                }
              })};
            str += "</ul>";
            if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' }
            if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' }
            $resultContent.innerHTML = str;
          });
          proceedsearch();
        }
      });}

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched == false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(function(e){
      $('.popup').hide();
      $(".popoverlay").remove();
      $('body').css('overflow', '');
    });
    $('.popup').click(function(e){
      e.stopPropagation();
    });
  </script>


  

  

  

  


</body>
</html>
